package com.cskaoyan.bean.vo.admin_order_detail;

import com.cskaoyan.bean.po.MarketOrder;
import com.cskaoyan.bean.po.MarketOrderGoods;
import com.cskaoyan.bean.po.MarketUser;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author Trellis
 * @since 2022/09/12 23:18
 */
public class NewAdminOrderDetailVo {

    /**
     * orderGoods : [{"productId":341,"addTime":"2022-09-12 21:11:54","orderId":495,"goodsId":1181075,"goodsSn":"10030611","updateTime":"2022-09-12 21:11:54","specifications":["豪华版","银白","柜型"],"number":2,"picUrl":"http://182.92.235.201:8083/wx/storage/fetch/5dymhtnqxwdmq3u067w7.jpg","deleted":false,"price":299,"comment":0,"id":694,"goodsName":"这是名称（测试）"}]
     * user : {"nickname":"user123","avatar":""}
     * order : {"consignee":"zzz天改","address":"北京市市辖区东城区 12345","comments":0,"addTime":"2022-09-12 21:11:54","orderSn":"20220912183302","actualPrice":598,"mobile":"13007777776","orderStatus":202,"updateTime":"2022-09-12 21:15:55","message":"","userId":1,"grouponPrice":0,"deleted":false,"aftersaleStatus":0,"goodsPrice":598,"couponPrice":0,"orderPrice":598,"id":495,"freightPrice":0,"integralPrice":0}
     */
    private List<OrderGoodsEntity> orderGoods = new ArrayList<>();
    private UserEntity user = new UserEntity();
    private OrderEntity order = new OrderEntity();

    public void copyOrderGoods(MarketOrderGoods marketOrderGoods) {
        OrderGoodsEntity orderGoodsEntity = new OrderGoodsEntity();
        BeanUtils.copyProperties(marketOrderGoods,orderGoodsEntity);
        orderGoods.add(orderGoodsEntity);
    }

    public void copyUser(MarketUser marketUser) {
        UserEntity userEntity = new UserEntity();
        BeanUtils.copyProperties(marketUser,userEntity);
        user=userEntity;
    }


    public void copyOrder(MarketOrder marketOrder) {
        OrderEntity orderEntity = new OrderEntity();
        BeanUtils.copyProperties(marketOrder,orderEntity);
        order = orderEntity;
    }

    public void setOrderGoods(List<OrderGoodsEntity> orderGoods) {
        this.orderGoods = orderGoods;
    }

    public void setUser(UserEntity user) {
        this.user = user;
    }

    public void setOrder(OrderEntity order) {
        this.order = order;
    }

    public List<OrderGoodsEntity> getOrderGoods() {
        return orderGoods;
    }

    public UserEntity getUser() {
        return user;
    }

    public OrderEntity getOrder() {
        return order;
    }

    public class OrderGoodsEntity {
        /**
         * productId : 341
         * addTime : 2022-09-12 21:11:54
         * orderId : 495
         * goodsId : 1181075
         * goodsSn : 10030611
         * updateTime : 2022-09-12 21:11:54
         * specifications : ["豪华版","银白","柜型"]
         * number : 2
         * picUrl : http://182.92.235.201:8083/wx/storage/fetch/5dymhtnqxwdmq3u067w7.jpg
         * deleted : false
         * price : 299.0
         * comment : 0
         * id : 694
         * goodsName : 这是名称（测试）
         */
        private int productId;
        private Date addTime;
        private int orderId;
        private int goodsId;
        private String goodsSn;
        private Date updateTime;
        private List<String> specifications;
        private int number;
        private String picUrl;
        private boolean deleted;
        private BigDecimal price;
        private int comment;
        private int id;
        private String goodsName;

        public void setProductId(int productId) {
            this.productId = productId;
        }

        public void setAddTime(Date addTime) {
            this.addTime = addTime;
        }

        public void setOrderId(int orderId) {
            this.orderId = orderId;
        }

        public void setGoodsId(int goodsId) {
            this.goodsId = goodsId;
        }

        public void setGoodsSn(String goodsSn) {
            this.goodsSn = goodsSn;
        }

        public void setUpdateTime(Date updateTime) {
            this.updateTime = updateTime;
        }

        public void setSpecifications(List<String> specifications) {
            this.specifications = specifications;
        }

        public void setNumber(int number) {
            this.number = number;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }

        public void setDeleted(boolean deleted) {
            this.deleted = deleted;
        }

        public void setPrice(BigDecimal price) {
            this.price = price;
        }

        public void setComment(int comment) {
            this.comment = comment;
        }

        public void setId(int id) {
            this.id = id;
        }

        public void setGoodsName(String goodsName) {
            this.goodsName = goodsName;
        }

        public int getProductId() {
            return productId;
        }

        public Date getAddTime() {
            return addTime;
        }

        public int getOrderId() {
            return orderId;
        }

        public int getGoodsId() {
            return goodsId;
        }

        public String getGoodsSn() {
            return goodsSn;
        }

        public Date getUpdateTime() {
            return updateTime;
        }

        public List<String> getSpecifications() {
            return specifications;
        }

        public int getNumber() {
            return number;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public boolean isDeleted() {
            return deleted;
        }

        public BigDecimal getPrice() {
            return price;
        }

        public int getComment() {
            return comment;
        }

        public int getId() {
            return id;
        }

        public String getGoodsName() {
            return goodsName;
        }
    }

    public class UserEntity {
        /**
         * nickname : user123
         * avatar :
         */
        private String nickname;
        private String avatar;

        public void setNickname(String nickname) {
            this.nickname = nickname;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public String getNickname() {
            return nickname;
        }

        public String getAvatar() {
            return avatar;
        }
    }

    public class OrderEntity {
        public Date getShipTime() {
            return shipTime;
        }

        public void setShipTime(Date shipTime) {
            this.shipTime = shipTime;
        }

        public String getShipChannel() {
            return shipChannel;
        }

        public void setShipChannel(String shipChannel) {
            this.shipChannel = shipChannel;
        }

        public String getShipSn() {
            return shipSn;
        }

        public void setShipSn(String shipSn) {
            this.shipSn = shipSn;
        }

        /**
         * consignee : zzz天改
         * address : 北京市市辖区东城区 12345
         * comments : 0
         * addTime : 2022-09-12 21:11:54
         * orderSn : 20220912183302
         * actualPrice : 598.0
         * mobile : 13007777776
         * orderStatus : 202
         * updateTime : 2022-09-12 21:15:55
         * message :
         * userId : 1
         * grouponPrice : 0.0
         * deleted : false
         * aftersaleStatus : 0
         * goodsPrice : 598.0
         * couponPrice : 0.0
         * orderPrice : 598.0
         * id : 495
         * freightPrice : 0.0
         * integralPrice : 0.0
         */
        private String consignee;
        @JsonFormat(pattern = "yyyy-MM-dd hh:MM:ss",timezone = "GMT+8")
        private Date shipTime;
        private String shipChannel;
        private String shipSn;
        private String address;
        private int comments;
        private Date addTime;
        private String orderSn;
        private BigDecimal actualPrice;
        private String mobile;
        private Short orderStatus;
        private Date updateTime;
        private String message;
        private int userId;
        private BigDecimal grouponPrice;
        private boolean deleted;
        private int aftersaleStatus;
        private BigDecimal goodsPrice;
        private BigDecimal couponPrice;
        private BigDecimal orderPrice;
        private int id;
        private BigDecimal freightPrice;
        private BigDecimal integralPrice;

        public void setConsignee(String consignee) {
            this.consignee = consignee;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public void setComments(int comments) {
            this.comments = comments;
        }

        public void setAddTime(Date addTime) {
            this.addTime = addTime;
        }

        public void setOrderSn(String orderSn) {
            this.orderSn = orderSn;
        }

        public void setActualPrice(BigDecimal actualPrice) {
            this.actualPrice = actualPrice;
        }

        public void setMobile(String mobile) {
            this.mobile = mobile;
        }

        public void setOrderStatus(Short orderStatus) {
            this.orderStatus = orderStatus;
        }

        public void setUpdateTime(Date updateTime) {
            this.updateTime = updateTime;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public void setUserId(int userId) {
            this.userId = userId;
        }

        public void setGrouponPrice(BigDecimal grouponPrice) {
            this.grouponPrice = grouponPrice;
        }

        public void setDeleted(boolean deleted) {
            this.deleted = deleted;
        }

        public void setAftersaleStatus(int aftersaleStatus) {
            this.aftersaleStatus = aftersaleStatus;
        }

        public void setGoodsPrice(BigDecimal goodsPrice) {
            this.goodsPrice = goodsPrice;
        }

        public void setCouponPrice(BigDecimal couponPrice) {
            this.couponPrice = couponPrice;
        }

        public void setOrderPrice(BigDecimal orderPrice) {
            this.orderPrice = orderPrice;
        }

        public void setId(int id) {
            this.id = id;
        }

        public void setFreightPrice(BigDecimal freightPrice) {
            this.freightPrice = freightPrice;
        }

        public void setIntegralPrice(BigDecimal integralPrice) {
            this.integralPrice = integralPrice;
        }

        public String getConsignee() {
            return consignee;
        }

        public String getAddress() {
            return address;
        }

        public int getComments() {
            return comments;
        }

        public Date getAddTime() {
            return addTime;
        }

        public String getOrderSn() {
            return orderSn;
        }

        public BigDecimal getActualPrice() {
            return actualPrice;
        }

        public String getMobile() {
            return mobile;
        }

        public int getOrderStatus() {
            return orderStatus;
        }

        public Date getUpdateTime() {
            return updateTime;
        }

        public String getMessage() {
            return message;
        }

        public int getUserId() {
            return userId;
        }

        public BigDecimal getGrouponPrice() {
            return grouponPrice;
        }

        public boolean isDeleted() {
            return deleted;
        }

        public int getAftersaleStatus() {
            return aftersaleStatus;
        }

        public BigDecimal getGoodsPrice() {
            return goodsPrice;
        }

        public BigDecimal getCouponPrice() {
            return couponPrice;
        }

        public BigDecimal getOrderPrice() {
            return orderPrice;
        }

        public int getId() {
            return id;
        }

        public BigDecimal getFreightPrice() {
            return freightPrice;
        }

        public BigDecimal getIntegralPrice() {
            return integralPrice;
        }
    }
}
